package org.nowcoder.huawei.c100;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 18 :小华地图寻宝
 */

public class HC018 {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String[] vars = br.readLine().split(" ");
            int n = Integer.parseInt(vars[0]);
            int m = Integer.parseInt(vars[1]);
            int k = Integer.parseInt(vars[2]);
            boolean[][] visited = new boolean[n][m];
            int sum = solve(visited, n, m, 0, 0, k);
            System.out.println(sum);
        } catch (IOException e) {
            //throw new RuntimeException(e);
        }
    }

    private static int sumOfDigits(int num) {
        int sum = 0;
        while (num > 0) {
            sum += num % 10;
            num = num / 10;
        }
        return sum;
    }

    public static int solve(boolean[][] visited, int n, int m, int i, int j, int k) {
        if (i < 0 || i >= n || j < 0 || j >= m || visited[i][j] || (sumOfDigits(i) + sumOfDigits(j)) > k) {
            return 0;
        }
        visited[i][j] = true;
        return 1 + solve(visited, n, m, i - 1, j, k) + solve(visited, n, m, i, j - 1, k) + solve(visited, n, m, i, j + 1, k) + solve(visited, n, m, i + 1, j, k);
    }
}
